//
//  RoundView.m
//  MyTrip
//
//  Created by zhang on 15/8/22.
//  Copyright (c) 2015年 张益. All rights reserved.
//

#import "RoundView.h"



@implementation RoundView

- (void)dealloc
{
    [_bLabel release];
    [_picView release];
    [_mLabel release];
    [super dealloc];
}

- (instancetype) initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        self.bLabel = [[[UILabel alloc] initWithFrame:CGRectMake(5 * OffWidth, 5 * OffHeight, self.frame.size.width - 10 * OffWidth, self.frame.size.width - 10 * OffWidth)] autorelease];
        _bLabel.layer.masksToBounds = YES;
        _bLabel.layer.cornerRadius = self.frame.size.width / 2 - 5 * OffWidth;
        [self addSubview:_bLabel];
                
        self.mLabel = [[[UILabel alloc] initWithFrame:CGRectMake(0, self.frame.size.width, self.frame.size.width, (self.frame.size.height - self.frame.size.width))] autorelease];
        [self addSubview:_mLabel];
        [_mLabel setTextAlignment:NSTextAlignmentCenter];
        _mLabel.font = [UIFont systemFontOfSize:14];
        _mLabel.alpha = 0.5;
        
        self.picView = [[UIImageView alloc] initWithFrame:CGRectMake(25 * OffWidth, 30 * OffHeight, 40 * OffWidth, 40 * OffHeight)];
        [self addSubview:_picView];
        [self bringSubviewToFront:_picView];

    }
    return self;
}


- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{
    [(NSObject *)self.target performSelector:self.action withObject:self];
}










@end
